;;Ҫɾ
+24
+26
+20
+19
+21
+22
+23
+51
+58
+40
+1
+5
+6
+10
+11
+15
+53
+30
+3
+25

;-------------------------------------------

[@Main]
#IF
IsAdmin
#ACT
GoTo @MainTest
#ELSESAY
Coming Soon...\\\
<Leave/@exit>

[@MainTest]
#ACT
Loadvalue A1 "QuestDiary\Guild\Palace.txt" [Legends] [Palace]
Loadvalue A2 "QuestDiary\Guild\Palace.txt" [DigitalEmpire] [Palace]
Loadvalue A3 "QuestDiary\Guild\Palace.txt" [New_Dawn] [Palace]
#SAY
What guild are you in?\\
Each teleport costs {FCOLOR/10}5000{FCOLOR/12} Gold this goes\
towards guild funds\\

;------------------------------

#IF
Equal A1 "Active"
#SAY
<Legends/@MovePalace(Legends)>\
#ELSESAY
{FCOLOR/1}Legends{FCOLOR/12}\

;------------------------------

#IF
Equal A2 "Active"
#SAY
<Digital Empire/@MovePalace(DigitalEmpire)>\
#ELSESAY
{FCOLOR/1}Digital Empire{FCOLOR/12}\

;------------------------------

#IF
Equal A3 "Active"
#SAY
<New Dawn/@MovePalace(New_Dawn)>\\
<I want to purchase a palace/@Buy_Palace>\
<Leave/@Exit>
#ELSESAY
{FCOLOR/1}New Dawn{FCOLOR/12}\\
<I want to purchase a palace/@Buy_Palace>\
<Leave/@Exit>

;-----------------------------------------

[@Buy_Palace]
#IF
IsGuildMaster
#SAY
What guild are you leader of?\\
<Legends/@BuyPalace2(Legends)>\
<Digital Empire/@BuyPalace2(DigitalEmpire)>\
<New Dawn/@BuyPalace2(New_Dawn)>\\
<Leave/@Exit>
#ELSESAY
Only the guild leader can buy a palace...\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalace2()]
#ACT
mov A4 %ARG(1)
#IF
Equal A4 %GUILDNAME
#ACT
GoTo @BuyPalace3
#ELSESAY
You are not in  {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12} Guild...\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalace3]
#IF
Equal A4 "Legends"
#ACT
GoTo @BuyPalaceLegends
BREAK

;------------------------------

#IF
Equal A4 "DigitalEmpire"
#ACT
GoTo @BuyPalaceDigitalEmpire
BREAK

;------------------------------

#IF
Equal A4 "New_Dawn"
#ACT
GoTo @BuyPalaceNew_Dawn
BREAK

;-----------------------------------------

[@BuyPalaceLegends]
#SAY
{FCOLOR/10}Legends{FCOLOR/12}\\
<Pay 30,000,000 Gold for a guild palace/@BuyPalaceLegendsFinal>\\
You will also need:\
{FCOLOR/15}RedMoonCrystal{FCOLOR/12}\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalaceDigitalEmpire]
#SAY
{FCOLOR/10}Digital Empire:{FCOLOR/12}\\
<Pay 30,000,000 Gold for a guild palace/@BuyPalaceDigitalEmpireFinal>\\
You will also need:\
{FCOLOR/15}RedMoonCrystal{FCOLOR/12}\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalaceNew_Dawn]
#SAY
{FCOLOR/10}New Dawn{FCOLOR/12}\\
<Pay 30,000,000 Gold for a guild palace/@BuyPalaceNew_DawnFinal>\\
You will also need:\
{FCOLOR/15}RedMoonCrystal{FCOLOR/12}\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalaceLegendsFinal]
#IF
CheckGold 30000000
CheckItem RedMoonCrystal 1
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" [Legends] [Palace] Active
Take Gold 30000000
Take RedMoonCrystal 1
#SAY
Thank you...\\
Only members of {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12} Guild will be able to enter\
from the Bichon Administrator\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalaceDigitalEmpireFinal]
#IF
CheckGold 30000000
CheckItem RedMoonCrystal 1
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" [DigitalEmpire] [Palace] Active
Take Gold 30000000
Take RedMoonCrystal 1
#SAY
Thank you...\\
Only members of {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12} Guild will be able to enter\
from the Bichon Administrator\\
<Leave/@Exit>

;-----------------------------------------

[@BuyPalaceNew_DawnFinal]
#IF
CheckGold 30000000
CheckItem RedMoonCrystal 1
#ACT
SaveValue "QuestDiary\Guild\Palace.txt" [New_Dawn] [Palace] Active
Take Gold 30000000
Take RedMoonCrystal 1
#SAY
Thank you...\\
Only members of {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12} Guild will be able to enter\
from the Bichon Administrator\\
<Leave/@Exit>

;-------------------------------------------------------------------------------

[@MovePalace()]
#ACT
mov A4 %ARG(1)
#IF
Equal A4 %GUILDNAME
#ACT
GoTo @CheckMovePalace
#ELSESAY
You are not in  {FCOLOR/10}<$OUTPUT(A4)>{FCOLOR/12} Guild...\\
<Leave/@Exit>

;-----------------------------------------

[@CheckMovePalace]
#ACT
Loadvalue A5 "QuestDiary\Guild\GoldStorage.txt" %GUILDNAME [Gold]

#ACT
mov D2 %A5
mov D3 5000

#IF
CheckGold %D3
#ACT
Take Gold %D3
INC D2 %D3
SaveValue "QuestDiary\Guild\GoldStorage.txt" %GUILDNAME [Gold] %D2
#ACT
GoTo @MovePalace3
#ELSESAY
You do not have {FCOLOR/10}<$OUTPUT(D3)>{FCOLOR/12} Gold...\\
<Leave/@Exit>

;-----------------------------------------

[@MovePalace3]
#IF
Equal A4 "Legends"
#ACT
DelayGoto [Local] 3 @TeleportLegends
#SAY
Done...\\
{FCOLOR/10}Please Wait...{FCOLOR/12}\
Guild Gold: {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\\
<Leave/@Exit>

;------------------------------

#IF
Equal A4 "DigitalEmpire"
#ACT
DelayGoto [Local] 3 @TeleportDigitalEmpire
#SAY
Done...\\
{FCOLOR/10}Please Wait...{FCOLOR/12}\
Guild Gold: {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\\
<Leave/@Exit>

;------------------------------

#IF
Equal A4 "New_Dawn"
#ACT
DelayGoto [Local] 3 @TeleportNewDawn
#SAY
Done...\\
{FCOLOR/10}Please Wait...{FCOLOR/12}\
Guild Gold: {FCOLOR/10}<$OUTPUT(D2)>{FCOLOR/12}\\
<Leave/@Exit>

;-----------------------------------------

[@TeleportLegends]
#ACT
mapmove Guild1 23 50
CLOSE

;------------------------------

[@TeleportDigitalEmpire]
#ACT
mapmove Guild2 23 50
CLOSE

;------------------------------

[@TeleportNewDawn]
#ACT
mapmove Guild3 23 50
CLOSE

;------------------------------


;;Ҫɾ